package com.onlineclass.onlineclassmanagement.controller;

import com.onlineclass.beas.ResultObject;
import com.onlineclass.beas.User;
import com.onlineclass.onlineclassmanagement.feign.GetSchoolFeign;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/Universitypage")
@Slf4j
public class SchoolInfoController {

    @Autowired
    GetSchoolFeign getSchoolFeign;

    @RequestMapping("/getSchoolinfo")
    public ResultObject getSchoolinfo(User user) {
//        log.info(String.valueOf(text.getClass()));
//        Integer i=Integer.parseInt(text);
        log.info(String.valueOf(user));

        int id = user.getId();
        log.info(String.valueOf(id));
        ResultObject o = getSchoolFeign.getSchoolInfo(id);
        System.out.println("dwvudwud" + o);
        return o;
    }
}
